﻿using System;
using System.Collections.Generic;
using System.ComponentModel;
using System.Drawing;
using System.Data;
using System.Linq;
using System.Text;
using System.Windows.Forms;
using TvTipper.Entities;

namespace TvTipper.Controls
{
    public partial class BaseInfoPanel : UserControl
    {
        public BaseInfoPanel()
        {
            InitializeComponent();
        }

        public virtual void LoadEntity(Entity entity)
        {
            Clear();
            LoadNewEntity(entity);
        }

        protected virtual void Clear() { }
        protected virtual void LoadNewEntity(Entity entity) { }

        protected void ClearAllTextFields()
        {
            foreach (var ctrl in this.Controls)
            {
                var tb = ctrl as TextBox;
                if (tb != null)
                {
                    tb.Text = "";
                }
            }
        }
    }
}
